package ducna.android.aoeclip.screen.splash;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.widget.ImageView;

import ducna.android.aoeclip.R;
import ducna.android.aoeclip.screen.category.CategoryActivity;

/**
 * Created by DUCNA on 11/4/2014.
 */
public class SplashActivity extends Activity {

    private int TIME_SPLASH = 3000;
    private ImageView mImageViewSplash;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_splash);
        mImageViewSplash = (ImageView)findViewById(R.id.imageViewSplash);
        mImageViewSplash.setImageResource(R.drawable.splash);
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                Intent intent = new Intent(SplashActivity.this, CategoryActivity.class);
                startActivity(intent);
                finish();
            }
        }, TIME_SPLASH);
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mImageViewSplash.setImageDrawable(null);
    }
}
